package com.nancy.java_design.command.demo1;

import java.util.List;

/**
 * 命令模式
 * 调用者
 */
public class Waiter {
    private List<Command> commands;

    public void setCommands(List<Command> commands) {
        this.commands = commands;
    }

    public void notifyAllCommand() {
        for (Command command : commands) {
            command.execute();
        }
    }
}
